package cn.eyesea.cc.frame.factory;

import cn.eyesea.cc.frame.base.Assembly;
import cn.eyesea.cc.frame.base.impl.assembly.DoAssembly;
import cn.eyesea.cc.frame.enums.LogicalTypeEnum;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.Map;

/**
 * 组件库工厂
 *
 * @author wanghuilong
 * @version 1.0
 * @date 2021/7/18 9:10 下午
 */
@Slf4j
public class AssemblyFactory {

    static Map<LogicalTypeEnum, Assembly> assemblys = new HashMap(50);

    static {
        DoAssembly doAssembly = new DoAssembly();
        assemblys.put(doAssembly.getLogicalType(), doAssembly);
    }

    public static Assembly getAssembly(LogicalTypeEnum logicalTypeEnum) {
        if (null == logicalTypeEnum) {
            log.error("");
        }
        return assemblys.get(logicalTypeEnum);
    }


}
